﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BI.CF.Model;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using BI.CF.PageList;
using BI.CF.IDAL;

namespace BI.CF.DAL
{
    public class MemIncome_DAL : MemIncome_IDAL
    {

        /// <summary>
        /// 显示某位会员所有投资记录
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public MemIncomeModel Get_MemIncome(int ID)
        {
            SqlParameter[] Paramter = { new SqlParameter("@MemLoanId", SqlDbType.Int) };
            Paramter[0].Value = ID;
            MemIncomeModel m = new MemIncomeModel();
            SqlDataReader Read = DbHelperSQL.RunProcedure("Proc_MemIncomeSelect", Paramter);
            while (Read.Read())
            {
                m.CollectInterest = decimal.Parse(Read["CollectInterest"].ToString());
                m.CollectPrincipal = decimal.Parse(Read["CollectPrincipal"].ToString());
                m.CollectTotal = decimal.Parse(Read["CollectTotal"].ToString());
                m.InComeSum = decimal.Parse(Read["InComeSum"].ToString());
                m.InvestmentSum = decimal.Parse(Read["InvestmentSum"].ToString());
                m.MemIncomeId = int.Parse(Read["MemIncomeId"].ToString());
                m.UserrId = int.Parse(Read["UserrId"].ToString());
            }
            return m;
        }
    }
}
